<template>
  <div>
      <TopBar>通知中心</TopBar>
      <div class="msgConatainer"  style="margin-top:1.5rem">
        <div 
          class="msgRow vux-1px-b"
          v-for="item in list"
          :key="item.id"
          @click="messageDetail(item)"
          >
          <span>{{item.title}}</span>
          <span>{{item.fbtime}}</span>
        </div>
      </div>
  </div>
</template>
<script>
import TopBar from '../../component/common/TopBar'
import {getMsg} from '../../../service/getData'
import {getSDK} from '../../../service/wxShare.js'

export default {
  components:{
    TopBar
  },
  beforeCreate(){
    getSDK();
  },
  created(){
    getMsg()
      .then(res=>{
        //console.log(res)
        this.list = res.list
      })
  },
  data(){
    return {
      list:[
        // {
        //   title:'短融网上线通告',
        //   date:'2018.03.13',
        //   content:`上线啦~~~~~~~~~上线啦~~~~~
        //   ~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~
        //   ~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~`
        // },
        // {
        //   title:'短融网上线通告',
        //   date:'2018.03.13',
        //   content:'上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~'
        // },
        // {
        //   title:'短融网上线通告',
        //   date:'2018.03.13',
        //   content:'上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~上线啦~~~~~~~~~'
        // },
      ]
    }
  },
  methods:{
    messageDetail(item){
      this.$router.push({name:'MsgDetail',params:{item}})
    }
  }
}
</script>
<style lang="less">
  @import '../../../style/mixin.less';
  .msgConatainer{
    .wh(8.2933rem,100%);
    margin:0 auto;
    .msgRow{
      .wh(100%,1.4933rem);
      .fx(row,space-between);
      font-weight: bold;
      font-size: 0.4rem;
    }
  }
</style>
